home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / tclX6.4c / dist / tests / pushd.test < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.5 KB  |  70 lines

  1. #
  2. # pushd.test
  3. #
  4. # Tests for tcl.tlib directory directory stack routines.
  5. #
  6. #---------------------------------------------------------------------------
  7. # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
  8. #
  9. # Permission to use, copy, modify, and distribute this software and its
  10. # documentation for any purpose and without fee is hereby granted, provided
  11. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  12. # Mark Diekhans make no representations about the suitability of this
  13. # software for any purpose.  It is provided "as is" without express or
  14. # implied warranty.
  15. #------------------------------------------------------------------------------
  16. # $Id: pushd.test,v 2.0 1992/10/16 04:50:08 markd Rel $
  17. #------------------------------------------------------------------------------
  18. #
  19.  
  20. if {[info procs test] == ""} then {source testlib.tcl}
  21.  
  22. rename SAVED_UNKNOWN unknown
  23.  
  24. set CWD [pwd]
  25.  
  26. cd /tmp
  27.  
  28. #
  29. # Get actual location of /tmp incase its symbolicly linked.
  30. #
  31. set TMP [pwd]
  32.  
  33. Test pushd-1.1 {ppushd command} {
  34.     pushd
  35. } 0 {}
  36.  
  37. Test pushd-1.2 {pushd command} {
  38.     set dummy $TCLENV(dirPushList)
  39. } 0 $TMP
  40.  
  41. Test pushd-1.3 {pushd command} {
  42.     pushd /
  43. } 0 {}
  44.  
  45. Test pushd-1.4 {pushd command} {
  46.     set TCLENV(dirPushList)
  47. } 0 "$TMP $TMP"
  48.  
  49. cd $CWD
  50.  
  51. Test popd-1.1 {popd command} {
  52.     popd
  53. } 0 $TMP
  54.  
  55. Test popd-1.2 {popd command} {
  56.     set TCLENV(dirPushList)
  57. } 0 $TMP
  58.  
  59. Test popd-1.3 {popd command} {
  60.     popd
  61.     popd
  62. } 1 {directory stack empty}
  63.  
  64. Test popd-1.4 {popd command} {
  65.     set TCLENV(dirPushList)
  66. } 0 {}
  67.  
  68. cd $CWD
  69. rename unknown SAVED_UNKNOWN
  70.